﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GZSolver
{
  class Program
  {
    static void Main(string[] args)
    {
      InitialConditionsFileReader dataSetReader = new InitialConditionsFileReader("data_set.txt");
      Matrix a = dataSetReader.MatrixCoefficients;
      double[] b = dataSetReader.BVector;

      LinearSystemSolvingResults gaussZeidelSolvingResults = new SequentialGaussZeidelCalculator().SolveLinearSystem(a, b, dataSetReader.Epsilon);
      LinearSystemSolvingResults parallelZeidelSolvingResults = new ParallelGausZeidelLinearSystemCalculator().SolveLinearSystem(a, b, dataSetReader.Epsilon);
      ResultsWriter.PrintResult(gaussZeidelSolvingResults, ResultsWriter.SourceOutput.CONSOLE | ResultsWriter.SourceOutput.FILE);
      ResultsWriter.PrintResult(parallelZeidelSolvingResults, ResultsWriter.SourceOutput.CONSOLE | ResultsWriter.SourceOutput.FILE);
      Console.ReadKey();
    }
  }
}
